package com.xin.di.uav.applet.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xin.di.uav.common.request.user.ReceivingInformationAddRequest;
import com.xin.di.uav.common.request.user.ReceivingInformationRequest;
import com.xin.di.uav.common.response.user.ReceivingInformationResponse;
import com.xin.di.uav.user.entity.CityReceivingInformation;
import com.xin.di.uav.user.entity.ReceivingInformation;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>
 * 收货信息表 服务类
 * </p>
 *
 * @author LTQ
 * @since 2023-04-04
 */
public interface IReceivingInformationService extends IService<ReceivingInformation> {
    /**
     * 添加收货地址
     *
     * @param receivingInformationRequest
     */
    void add(@RequestBody ReceivingInformationRequest receivingInformationRequest);


    /**
     * 编辑收货地址
     *
     * @param receivingInformationRequest
     */
    void edit(@RequestBody ReceivingInformationRequest receivingInformationRequest);

    /**
     * 添加收货地址
     *
     * @param receivingInformationAddRequest
     */
    void addAddress(@RequestBody ReceivingInformationAddRequest receivingInformationAddRequest);

    /**
     * 编辑收货地址
     *
     * @param receivingInformationRequest
     */
    void editAddress(@RequestBody ReceivingInformationRequest receivingInformationRequest);

    /**
     * 查询最近10条
     *
     * @param num
     * @return
     */
    List<ReceivingInformationResponse> getLastTen(@RequestParam Integer num);

    /**
     * 查询最近10条
     *
     * @param num
     * @param page
     * @param size
     * @return
     */
    List<ReceivingInformationResponse> getLastTenAddress(@RequestParam Integer num, @RequestParam Integer page, @RequestParam Integer size);

    /**
     * 删除
     *
     * @param id
     */
    void delete(@RequestParam String id, String userId);

    /**
     * 救援收货地址删除
     *
     * @param id
     * @param userId
     */
    void deleteRescue(@RequestParam String id, String userId);

    /**
     * 查询总条数
     *
     * @return
     */
    Long getTotal();

    /**
     * 插入
     *
     * @param entity
     * @return
     */
    int insert(CityReceivingInformation entity);

    /**
     * 通过id更新
     *
     * @param entity
     * @return
     */
    int updateById(@Param(Constants.ENTITY) CityReceivingInformation entity);

    /**
     * 批量查询
     *
     * @param queryWrapper
     * @return
     */
    List<CityReceivingInformation> selectList(@Param(Constants.WRAPPER) Wrapper<CityReceivingInformation> queryWrapper);

    /**
     * 分页查询
     *
     * @param page
     * @param queryWrapper
     * @return
     */
    IPage<CityReceivingInformation> selectPage(Page<CityReceivingInformation> page, @Param(Constants.WRAPPER) Wrapper<CityReceivingInformation> queryWrapper);

    /**
     * 救援获取明文手机号
     *
     * @param id
     * @return
     */
    ReceivingInformation getPhoneNum(String id);

}
